package com.maikang.exammall.repository;

import com.maikang.exammall.entity.Kefu;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;


@Repository
public interface KefuRepository extends BaseRepository<Kefu, Long>, JpaSpecificationExecutor<Kefu> {

    @Query("SELECT kefu.name FROM Kefu kefu WHERE kefu.isOnline = true ")
    @Modifying
    List<String> findNameByIsOnline();

    @Query("SELECT kefu.name FROM Kefu kefu ")
    @Modifying
    List<String> findName();

}
